﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.Infrastructure.Attr;
using WCS.Infrastructure.Dto.Request.Coupon;
using WCS.Infrastructure.Dto.Request.Lottery;
using WCS.Infrastructure.Dto.Request.User;
using WCS.Infrastructure.Dto.Response.Common;

namespace WCS.Service.Interface
{
    [Provider]
    public interface ICouponService
    {
        /// <summary>
        /// 新增优惠券模板
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> AddCouponTemplateAsync(CouponTemplateCreateRequestDto dto);

        /// <summary>
        /// 修改优惠券模板
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateCouponTemplateAsync(CouponTemplateCreateRequestDto dto);

        /// <summary>
        /// 获取优惠券模板列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetCouponTemplateListAsync(CouponTemplateQueryRequestDto dto);

        /// <summary>
        /// 获取单个优惠券模板详情
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetCouponTemplateDetailAsync(string id);

        /// <summary>
        /// 删除优惠券模板
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> DeleteCouponTemplateListAsync(string id);

        /// <summary>
        /// 优惠券模板增加库存
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> IncreaseCouponTemplateInventoryAsync(IncreaseCouponTemplateInventoryRequestDto dto);

        /// <summary>
        /// 新增优惠券包
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> AddCouponPackageAsync(CouponPackageRequestDto dto);

        /// <summary>
        /// 编辑优惠券包
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateCouponPackageAsync(CouponPackageRequestDto dto);

        /// <summary>
        /// 获取优惠券包列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetCouponPackageListAsync(CouponPackageRequestDto dto);

        /// <summary>
        /// 获取单个优惠券包详情
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetCouponPackageAsync(CouponPackageRequestDto dto);

        /// <summary>
        /// 删除优惠券包
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> DeleteCouponPackageAsync(CouponPackageRequestDto dto);

        /// <summary>
        /// 领取优惠券包(C端用户要先登录)
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> ReceiveCouponPackageAsync(CouponPackageReceiveRecordRequestDto dto);

        /// <summary>
        /// 获取用户优惠券列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetUserCouponInstanceListAsync(CouponInstanceQueryRequestDto dto);

        /// <summary>
        /// 平台随机推送优惠券
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> PlatformRandomlyPusheCouponAsync(CouponTemplateQueryRequestDto dto);

        /// <summary>
        /// 用户领取优惠券
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> UserGetCouponAsync(CouponInstanceCreateRequestDto dto);

        /// <summary>
        /// 确认核销（支付成功回调时调用）
        /// </summary>
        /// <param name="couponInstanceId">优惠券实例Id</param>
        /// <param name="orderId">订单Id</param>
        /// <returns>ApiResult</returns>
        Task<ApiResult> ConfirmCouponConsumptionAsync(string couponInstanceId, string orderId);

        /// <summary>
        /// 撤销核销（支付失败/取消/超时等场景调用）
        /// </summary>
        /// <param name="couponInstanceId">优惠券实例Id</param>
        /// <param name="orderId">订单Id</param>
        /// <returns>ApiResult</returns>
        Task<ApiResult> CancelCouponConsumptionAsync(string couponInstanceId, string orderId);

        /// <summary>
        /// 礼品券核销
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> RedeemGiftCouponAsync(GiftCouponRedeemRequestDto dto);

        /// <summary>
        /// 计算优惠券实例
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> CalculateCouponInstanceAsync(CalculateCouponInstanceRequestDto dto);

        /// <summary>
        /// 新增优惠券核销记录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>

        Task<ApiResult> AddCouponConsumptionRecordAsync(CouponConsumptionRecordRequestDto dto);

        ///// <summary>
        ///// 获取单个优惠券核销记录详情
        ///// </summary>
        ///// <param name="dto"></param>
        ///// <returns></returns>
        //Task<ApiResult> GetCouponConsumptionRecordAsync(CouponConsumptionRecordRequestDto dto);

        /// <summary>
        /// 获取优惠券核销记录列表
        /// </summary>
        /// <returns></returns>
        Task<ApiResult> GetCouponConsumptionRecordListAsync();

        /// <summary>
        /// 过期优惠券实例处理
        /// </summary>
        /// <returns></returns>
        Task<ApiResult> ExpireCouponInstancesAsync(List<string>? userIds, List<string>? templateIds);

        /// <summary>
        /// 新增抽奖活动
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> AddLotteryActivityAsync(LotteryActivityCreateRequestDto dto);

        /// <summary>
        /// 获取抽奖活动列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetLotteryActivityListAsync(LotteryActivityQueryRequestDto dto);

        /// <summary>
        /// 获取单个抽奖活动详情
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task<ApiResult> GetLotteryActivityDetailAsync(string Id);

        /// <summary>
        /// 编辑单个抽奖活动基本信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateLotteryActivityAsync(LotteryActivityCreateRequestDto dto);

        /// <summary>
        /// 编辑单个抽奖活动状态
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateLotteryActivityStatusAsync(LotteryActivityUpdateRequestDto dto);

        /// <summary>
        /// 删除抽奖活动
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task<ApiResult> DeleteLotteryActivityAsync(string Id);

        /// <summary>
        /// 新增抽奖奖品（批量）
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> AddLotteryPrizesAsync(LotteryPrizeCreateRequestDto dto);

        /// <summary>
        /// 编辑抽奖奖品（批量）
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateLotteryPrizesAsync(LotteryPrizeCreateRequestDto dto);

        /// <summary>
        /// 点击抽奖
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> LotteryDrawAsync(LotteryDrawRequestDto dto);

        /// <summary>
        /// 新增抽奖领取记录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> AddLotteryClaimRecordAsync(LotteryClaimRecordCreateRequestDto dto);

        /// <summary>
        /// 获取抽奖领取记录列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetLotteryClaimRecordListAsync(LotteryClaimRecordQueryRequestDto dto);

        /// <summary>
        /// 获取用户奖品列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult> GetUserLotteryPrizesListAsync(LotteryClaimRecordQueryRequestDto dto);

        /// <summary>
        /// 活动激活优惠券实例
        /// </summary>
        /// <returns></returns>
        Task<ApiResult> ActivateCouponInstanceAsync(LotteryPrizeActivateRequestDto dto);
    }
}
